#include<iostream>
#include <string.h>

using namespace std;

int func(char c)
{
	if(c==' ')return 1;
	if(c=='!')return 1;
	return 0;
}

int main()
{
	char s[100]="   I   like ,,,..    C++ programming!";
	int i;
	while(s[i]!='\0')
 		{
 			while(func(s[i])==1&&s[i]!='\0')
 			i++;
 			int start=i;
 			while(func(s[i])==0&&s[i]!='\0')
 				i++;
 			int end=i-1;
 			for(int j=end;j>=start;j--)
 			      cout<<s[j];
 			      cout<<" ";
 		}
 		return 0;

}
